import { defineStore } from 'pinia'

export const useGasStore = defineStore('gas', {
  state: () => ({
    O2: [ ],
    CO: [ ],
    CH4: [ ],
    smoke: [ ],
    dust: [ ]
  }),
  actions: {
    saveO2Data (O2Data:any) {
      this.O2 = []
      this.O2 = O2Data 
      console.log('存储O2的数据---->', this.O2, O2Data)
    },
    saveCOData (COData: any) {
      this.CO = []
      this.CO = COData
      console.log('存储CO的数据---->', this.CO, COData)
    },
    saveCH4Data (CH4Data: any) {
      this.CH4 = []
      this.CH4 = CH4Data
      console.log('存储CH4的数据---->', this.CH4, CH4Data)
    },
    saveDustData (dustData: any) {
      this.dust = []
      this.dust = dustData
      console.log('存储dust的数据---->', this.dust, dustData)
    },
    saveSmokeData (smokeData: any) {
      this.smoke = []
      this.smoke = smokeData
      console.log('存储smoke的数据---->', this.smoke, smokeData)
    }
  }
})
